package com.sali.b_design_pattern.m_status_pattern;

import com.sali.b_design_pattern.m_status_pattern.service.impl.BlinkState;
import com.sali.b_design_pattern.m_status_pattern.service.impl.OffState;
import com.sali.b_design_pattern.m_status_pattern.service.impl.OnState;

public class Main {

    public static void main(String[] args) {
        String command = "OFF";

        LightContext lightContext = new LightContext();

        switch (command) {
            case "ON":
                lightContext.setState(new OnState());
                break;
            case "OFF":
                lightContext.setState(new OffState());
                break;
            case "BLINK":
                lightContext.setState(new BlinkState());
                break;
            default:
                System.out.println("Invalid command: " + command);
        }

        System.out.println(lightContext.performOperation());
    }


}
